#include <iostream>

class Box{
    friend class Box2;
    double width;
    public:
        friend void printWidth(Box box);
        void setWidth(double wid);
};

void Box::setWidth(double wid){
    width=wid;
}

void printWidth(Box box){
    std::cout<<box.width<<std::endl;
}

class Box2{
    public:
        void printWidth(Box box){
            std::cout<<box.width<<std::endl;
        }
};

int main(){
    Box box;
    box.setWidth(10);
    printWidth(box);
    Box2 box2;
    box2.printWidth(box);
    return 0;
}
